package com.sysd.imgboard.util;

import org.mobylet.core.Carrier;
import org.mobylet.core.Mobylet;
import org.mobylet.core.MobyletFactory;

public class ForwardUtil {

    private static String JSP_PATH_DOCOMO = "/pages/user/mobile/";
    private static String JSP_PATH_AU = "/pages/user/mobile/";
    private static String JSP_PATH_SOFTBANK = "/pages/user/mobile/";
    private static String JSP_PATH_OTHER = "/pages/user/pc/";
    
    public static String forwardJsp(String jsp){
        Mobylet mobylet = MobyletFactory.getInstance();
        Carrier carrier = mobylet.getCarrier();

        jsp = jsp.replaceAll("^/", "");
        
        switch (carrier) {
        case DOCOMO:
            //ドコモ端末の場合の処理
            return JSP_PATH_DOCOMO + jsp;
        case AU:
            //au端末の場合の処理
            return JSP_PATH_AU + jsp;
        case SOFTBANK:
            //ソフトバンク3G端末の場合の処理
            return JSP_PATH_SOFTBANK + jsp;
        case OTHER:
            //PC若しくは上記以外の端末の場合の処理
            return JSP_PATH_OTHER + jsp;
        }


        return jsp;
    }
   
   
}
